﻿#pragma once


// CNumEdit

class CNumEdit : public CEdit
{
	DECLARE_DYNAMIC(CNumEdit)

public:
	CNumEdit();
	virtual ~CNumEdit();

private:
	int			m_nDotLeftNum;			// the maximum number of digits before the decimal point.
	int			m_nDotRightNum;			// the maximum number of digits after the decimal point.
	double		m_dMaxValue;
	double		m_dMinValue;

public:
	void		SetDotLeftNum(int nDotLeftNum);
	int			GetDotLeftNum() const;
	void		SetDotRightNum(int nDotRightNum);
	int			GetDotRightNum() const;

	void		SetMaxValue(double dValue);
	void		SetMinValue(double dValue);

	int			CheckNumValid();			// -1 左边超长， 0 符合要求， 1 右边超长, 2 其他

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};


